﻿using System.Windows.Controls;
using VisualStock.Modules.StockMarket.HistoricalData.Interfaces;
using System.Windows.Input;
using System.Windows;

namespace VisualStock.Modules.StockMarket.HistoricalData
{
    public partial class HistoricalDataMenuView : UserControl, IHistoricalDataMenuView
    {
        public HistoricalDataMenuView()
        {
            InitializeComponent();

            if (Application.Current.IsRunningOutOfBrowser)
            {
                InstallBtn.IsEnabled = false;
            }
        }

        #region IHistoricalDataMenuView Members

        public IHistoricalDataMenuViewModel Model
        {
            get { return this.DataContext as IHistoricalDataMenuViewModel; }
            set { this.DataContext = value; }
        }

        #endregion

        private void FullScreen_Click(object sender, RoutedEventArgs e)
        {
            Application.Current.Host.Content.IsFullScreen = !Application.Current.Host.Content.IsFullScreen;
        }

        private void Install_Click(object sender, RoutedEventArgs e)
        {
            Application.Current.Install();
        }
    }
}